﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.SIESystemManager.Calculate
{
    public class C_D14
    {
        public double GetD14(string W1, string W2)
        {
            double TD14 = 0, Tw1 = 0, Tw2 = 0;
            Tw1 = double.Parse(string.IsNullOrEmpty(W1) ? "0" : W1);
            Tw2 = double.Parse(string.IsNullOrEmpty(W2) ? "0" : W2);
            if ((Tw1 * Tw2) / 1000000 < 0.1)
            {
                TD14 = (2 * (Tw1 + Tw2) * 0.0179) / 2;
            }
            else if ((Tw1 * Tw2) / 1000000 <= 1.5 && (Tw1 * Tw2) / 1000000 >= 0.1)
            {
                TD14 = (2 * (Tw1 + Tw2) * 0.0256) / 2;
            }
            else
            {
                TD14 = (2 * (Tw1 + Tw2) * 0.0275) / 2;
            }

            return TD14;
        }
    }
}
